package com.teamin.service.impl;

import com.teamin.entity.Oole;
import com.teamin.entity.OoleProgress;
import com.teamin.mapper.OoleMapper;
import com.teamin.mapper.OoleProgressMapper;
import com.teamin.service.OoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * @Author: yangrui
 * @Description:
 * @Date: 下午6:06 2017/11/23
 */
@Service
public class OoleServiceImpl implements OoleService {

    @Autowired
    OoleMapper ooleMapper;

    @Autowired
    OoleProgressMapper ooleProgressMapper;

    @Transactional
    @Override
    public boolean saveOole() {
        Oole oole = new Oole();
        oole.setName("1833");
        ooleMapper.saveOole(oole);
        System.out.println(1/0);
        OoleProgress ooleProgress = new OoleProgress();
        ooleProgress.setName("1833");
        ooleProgress.setCreateTime(new Date());
        int i = ooleProgressMapper.saveOoleProgress(ooleProgress);
        return i > 0;
    }
}
